package com.marshall.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by
 *
 * @author : Marshall lky
 * datetime: 2021/11/3 10:14
 */
@Configuration
public class MyselfRule {

    @Bean
    public IRule myRule() {
        //定义为随机
        return new RandomRule();
    }


    public static void main(String[] args) {
        String op = "20_01";

        if (op.contains("_")) {
            op = op.substring(0, op.indexOf("_"));
        }
        System.out.println(op);
    }

}
